<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../easyUI/themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../easyUI/themes/icon.css">
		<script type="text/javascript" src="../easyUI/jquery.min.js"></script>
		<script type="text/javascript" src="../easyUI/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="../addressIP.js"></script>
		<script type="text/javascript" src="../datagrid-filter.js"></script>
	</head>
	<body>
		<table id="dg"></table>
		<script type="application/javascript">
			$('#dg').datagrid({

				columns: [
					[
						{
							field: 'pcNum',
							title: '编号',
							width: '25%',
                            align: 'center'
						},
						{
							field: 'labNum',
							title: '所属实验室',
							width: '25%',
                            align: 'center'
						},
						{
							field: 'state',
							title: '使用状态标识',
							width: '25%',
                            align: 'center',
							formatter: function(value, row, index) {
								if (row.state == '-1') {
									return "报修";
								}
								if (row.state == '0') {
									return "空闲";
								} else {
									return "工作";
								}
							}
						},
						{
							field: 'description',
							title: '信息',
							width: '25%',
                            align: 'center'
						}
					]
				]
			});
		</script>
		<script type="text/javascript">
			$(function() {
				var dg = $('#dg').datagrid({
					url: addressip + "/superGetComputer",
					queryParams: {
						account: localStorage.getItem("superAccount"),
						password: localStorage.getItem("password")
					},
					fitColumns: true,
					loadMsg: '数据加载中^_^',
					striped: true, //显示斑马线
					loadMsg: '等等我。。',
					idField: 'userID',
					rownumbers: true,
					pagination: true,
					fit: true,
					fitColumns: true,
					checkbox: true,
					autoRowHeight: false,
					emptyMsg: '暂无数据',
					pageSize: 15,
					pageList: [15, 25, 50, 99999995]
				});
				dg.datagrid('enableFilter', [{
					field: 'unitcost',
					type: 'numberbox',
					options: {
						precision: 1
					},
					op: ['less', 'greater']
				}]);
			});
		</script>
	</body>
</html>
